<!DOCTYPE html>
<html lang="en">
<head>
    <{include file="public_html/header_tag.html" }>
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=hr20tx53PVWOwhMWxkipwE7tN1pstQ1S"></script>
</head>
<body>
<header class="brB">
	<div class="h_top">
    	<div class="hLeft"><a href="javascript:;" class="icoH icoReturn mt20"></a></div>
    	<div class="hCenter"><span class="tit c-3ac9af">签到</span></div>
    </div>
</header>
<div class="warp">
	<div class="pt20 fix">
        <div class="b-FFFFFF plr20">
			<div class="layui-form-item">
				<label class="layui-form-label">经纬度</label>
				<div class="layui-input-block">
					<input type="text" name="lgn_lat" id="lgn_lat" value="" autocomplete="off" class="layui-input" readonly="readonly">
				</div>
				<div class="layui-input-block" style="width:800px;height:400px" id="allmap"></div>  
				<script type="text/javascript">
					// 百度地图API功能
					var map = new BMap.Map("allmap");
					var point = new BMap.Point(116.331398,39.897445);
					map.centerAndZoom(point,12);
					map.enableScrollWheelZoom(true);
					var geolocation = new BMap.Geolocation();
					geolocation.getCurrentPosition(function(r){
						if(this.getStatus() == BMAP_STATUS_SUCCESS){
							<{if isset($info) AND $info.longitude > 0 AND $info.latitude > 0}>
							r.point.lng = "<{$info.longitude}>";
							r.point.lat = "<{$info.latitude}>";
							<{/if}>
							var mk = new BMap.Marker(r.point);
							map.addOverlay(mk);
							map.panTo(r.point);
							$("#lgn_lat").val(r.point.lng + ", " + r.point.lat)
							mk.enableDragging();
							//标注拖拽后的位置
							mk.addEventListener("dragend", function (e) {
							   // alert("当前位置：" + e.point.lng + ", " + e.point.lat);
							   $("#lgn_lat").val(e.point.lng + ", " + e.point.lat)
							});
							
						}else {
							alert('failed'+this.getStatus());
						}
					},{enableHighAccuracy: true})
				</script>
			</div>
        </div>
	</div>
</div>
</body>
<!-- body 最后 -->
</html>